import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询智能柜列表
export function listCabinet(query) {
  return request({
    url: '/base/cabinet/list',
    method: 'get',
    params: query
  })
}

// 查询智能柜详细
export function getCabinet(cabinetId) {
  return request({
    url: '/base/cabinet/' +  parseStrEmpty(cabinetId),
    method: 'get'
  })
}

// 新增智能柜
export function addCabinet(data) {
  return request({
    url: '/base/cabinet',
    method: 'post',
    data: data
  })
}

// 修改智能柜
export function updateCabinet(data) {
  return request({
    url: '/base/cabinet',
    method: 'put',
    data: data
  })
}

// 删除智能柜
export function delCabinet(cabinetId) {
  return request({
    url: '/base/cabinet/' + cabinetId,
    method: 'delete'
  })
}

// 设置智能柜规格
export function updateGridAndLayer(data) {
  return request({
    url: '/base/cabinet/updateGridAndLayer',
    method: 'post',
    data: data
  })
}

// 查询智能柜列表
export function treeselectCabinet(cabinetId) {
  return request({
	url: '/base/cabinet/treeselectCabinet/' + cabinetId,
    method: 'get'
  })
}